//    Copyright (C) Kherty.  All rights reserved.
using System;

namespace OpenLS.Spreadsheet.AnalysisToolPak
{
    internal class Kelvin : UnitBase
    {
        public Kelvin() : base("K")
        {
        }

        public override double ConvertTo(double value, UnitBase other)
        {
            if (other is Kelvin)
                return value;
            if (other is Celsius)
                return value - 273.15;
            if (other is Farenheit)
                return (value*9d/5d) - 459.67;
            throw new NotSupportedException();
        }
    }
}